package com.example.myapplication;

import android.os.Bundle;

import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.AppCompatActivity;

import android.text.TextUtils;
import android.view.View;

import androidx.core.view.WindowCompat;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

import com.example.myapplication.databinding.ActivityMainBinding;

import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private EditText editText1, editText2;
    private Button button;
    private String account,password;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        editText1 = findViewById(R.id.et1);
        editText2 = findViewById(R.id.et2);
        button = findViewById(R.id.bt);
        button.setOnClickListener(this);

    }


   public void onClick(View view){
        account=editText1.getText().toString();
       password=editText2.getText().toString();
       if (TextUtils.isEmpty(account)|TextUtils.isEmpty(password)){
           Toast.makeText(this,"输入信息不完整",Toast.LENGTH_SHORT).show();
       }else {
           Toast.makeText(this,"登录成功",Toast.LENGTH_SHORT).show();
       }
       FileSaveQQ.saveUserInfo(this,account,password);
   }
}